In some photonic integrated circuits, waveguides are formed in the form of a rib or a channel structure. However it is difficult to control different etching depth levels across a wafer and across different patterns for rib type waveguides, which affects performance and yield. An exposed waveguide core during multi-step etching also results in a rough surface with significant transmission loss.